package org.dormi.learn.product.port.persist.product;

import org.dormi.learn.product.domain.product.entity.Product;
import org.dormi.learn.product.domain.product.entity.ProductCategory;
import org.dormi.learn.product.domain.product.repo.ProductRepository;
import org.dormi.learn.utils.TrackingUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * add description here
 *
 * @author : dormi330
 * @version : 1.0
 */
@Component
public class ProductRepositoryImpl implements ProductRepository {

    @Autowired private ProductDao productDao;

    @Override
    public void saveProduct(Product p) {
        TrackingUtils.debugTrace();
        ProductPO po = Converter.product_eo_to_po(p);
        productDao.save(po);
    }

    @Override
    public Product getById(Long id) {
        throw new RuntimeException("TODO");
    }

    @Override
    public void saveProductCatagory(ProductCategory e) {

    }
}
